﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jizsoft.Bases.Web.Services
{
    public class QueryService
    {
        public List<Models.Menu> QueryMenus()
        {
            List<Models.Menu> menus = new List<Models.Menu>();

            menus.Add(new Models.Menu()
            {
                Text="用户列表",
                LinkUrl="Bases/User/List",
                IconUrl=""
            });

            menus.Add(new Models.Menu()
            {
                Text = "Menu2",
                LinkUrl = "Bases/Home/index2",
                IconUrl = ""
            });

            Models.Menu menu3 = new Models.Menu()
            {
                Text = "Menu3",
                LinkUrl = "Bases/Home/index2",
                IconUrl = "",
                Children = new List<Models.Menu>()
            };
            menus.Add(menu3);
            for (int index = 0; index < 3; index++)
            {
                Models.Menu menu3_1 = new Models.Menu()
                {
                    Text = "Menu3-1",
                    LinkUrl = "Bases/Home/index2",
                    IconUrl = "",
                    Children = new List<Models.Menu>()
                };
                menu3.Children.Add(menu3_1);
                for (int lv2Index = 0; lv2Index < 2; lv2Index++)
                {
                    if (lv2Index == 1 && index == 1)
                    {
                        menu3_1.Children.Add(new Models.Menu()
                        {
                            Text = "Menu3-1-" + lv2Index.ToString(),
                            LinkUrl = "Bases/Home/index",
                            IconUrl = ""
                        });
                    }
                    else
                    {
                        menu3_1.Children.Add(new Models.Menu()
                        {
                            Text = "Menu3-1-" + lv2Index.ToString(),
                            LinkUrl = "Bases/Home/index2",
                            IconUrl = ""
                        });
                    }
                }
            }


                return menus;
        }
    }
}
